package com.wanxi.product.service.api.feign;

import com.wanxi.product.service.api.query.user.SkuQuery;
import com.wanxi.product.service.api.result.CommonResult;
import com.wanxi.product.service.api.util.TypeEnum;
import com.wanxi.product.service.api.vo.user.SkuFindAllOutVo;
import com.wanxi.product.service.api.vo.user.SkuFindByIdOutVo;
import com.wanxi.product.service.api.vo.user.TypeFindAllOutVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "product-server")
@RequestMapping("/user")
public interface ProductUserService {
    /**
     * 获取sku列表
     * @param skuQuery
     * @return
     */
    @GetMapping("/sku/findAll")
    CommonResult<List<SkuFindAllOutVo>> findAllSku(@RequestBody SkuQuery skuQuery);

    /**
     * 根据id查找sku
     * @param skuId
     * @return
     */
    @GetMapping("/sku/findById")
    CommonResult<SkuFindByIdOutVo> findSkuById(@RequestParam(name = "skuId") Long skuId);

    /**
     * 查找一级、二级或三级分类
     * @param typeCode
     * @return
     */
    @GetMapping("/type/findAll")
    CommonResult<List<TypeFindAllOutVo>> findAllType(@RequestParam(name = "typeCode") int typeCode);

}
